﻿CREATE VIEW dbo.VIEW_PAY_IN_ON_SERVICE
AS
SELECT        dbo.PAY_IN_ON_SERVICE.ID, dbo.PAY_IN_ON_SERVICE.PAYMENT_IN_ID, dbo.PAY_IN_ON_SERVICE.NSI_SERVICE_ID, 
                         dbo.NSI_SERVICE.SHORT_NAME AS NSI_SERVICE_NAME, dbo.NSI_METER.SHORT_NAME AS NSI_METER_NAME, dbo.PAY_IN_ON_SERVICE.QAUNTITY
FROM            dbo.PAY_IN_ON_SERVICE INNER JOIN
                         dbo.NSI_SERVICE ON dbo.PAY_IN_ON_SERVICE.NSI_SERVICE_ID = dbo.NSI_SERVICE.ID LEFT OUTER JOIN
                         dbo.NSI_METER ON dbo.NSI_SERVICE.NSI_METER_ID = dbo.NSI_METER.ID